<template>
	<view>
		<view class="tabbar">
			<view @click="tabbar_activeNum =1" class="body">
				<image :src="1==tabBarIndex?home1:home2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==1}">打卡</view>
			</view>
			<view @click="tabbar_activeNum=2" class="body">
				<image :src="2==tabBarIndex?active1:active2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==2}">统计</view>
			</view>
			<view @click="tabbar_activeNum=3" class="body">
				<image :src="3==tabBarIndex?shop1:shop2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==3}">申请</view>
			</view>
		<!-- 	<view @click="tabbar_activeNum=4" class="body">
				<image :src="4==tabBarIndex?user1:user2"></image>
				<view class="tabbar_title" :class="{tabbar_active:tabBarIndex==4}">我的</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		name: "tabbar",
		props:{
			tabBarIndex:Number
		},
		data() {
			return {
				tabbar_activeNum: 0,
				// 首页
				home1: '/static/check_tabBar/imgdaka-1.png',
				home2: '/static/check_tabBar/imgdaka.png',
				//统计
				active1: '/static/check_tabBar/imgtongji-1.png',
				active2: '/static/check_tabBar/imgtongji.png',
				//申请
				shop1: '/static/check_tabBar/imgshenqing-1.png',
				shop2: '/static/check_tabBar/imgshenqing.png',
				//我的
				user1: '/static/check_tabBar/imgshenqing-1.png',
				user2: '/static/check_tabBar/imgshenqing.png',
			};
		},
		watch: {
			tabbar_activeNum(event) {
				if (event == 1) {
					uni.reLaunch({
						url: '/pages/work/company_check/company_check'
					})
				} else if (event == 2) {
					uni.reLaunch({
						url: '/pages/work/company_check/company_statistics'
					})
				} else if (event == 3) {
				uni.reLaunch({
					url: '/pages/work/company_check/company_form'
				})
				} else if (event == 4) {
					uni.reLaunch({
						url: '/pages/user/index'
					})
				}
			}
		},
		methods:{
			
		}
	}
</script>

<style lang="scss">
	.tabbar {
		z-index: 9999;
		width: 750rpx;
		height: 100rpx;
		background: #FFFFFF;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		justify-content: space-between;
		padding-left: 30rpx;
		padding-right: 30rpx;
		text-align: center;
		align-items: center;

		.body {

			image {
				height: 44rpx;
				width: 44rpx;
			}
			.issue{
				width: 68rpx;
				height: 68rpx;
				opacity: 1;
			}


			.tabbar_title {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #5B5E63;
				opacity: 1;
			}
		}
	}

	.tabbar_active {
		color: #43D1BE !important;
	}
	
	
	
	
	
	
	.item_wrap {
		width: 100%;
		display: flex;
		flex-wrap: wrap;
		overflow: hidden;
	}
	
	.item_body {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.4);
		z-index: 9999;
	}
	
	.submit_bottom {
		position: absolute;
		bottom: 0;
		left: 0;
		right: 0;
		width: 750rpx;
		height: 430rpx;
		background: #FFFFFF;
		opacity: 1;
		border-radius: 31rpx 31rpx 0px 0px;
	}
	
	.item_img {
		width: 82rpx;
		height: 82rpx;
	}
	
	.close {
		width: 50rpx;
		height: 50rpx;
		background-image: url(/static/icon/closeicons.png);
		background-repeat: no-repeat;
		background-size: 100% 100%;
	}
</style>
